require "common"
local WMaxNum = {12,17,18,20,20}
local SMaxNum = {12,20,20}
local RMaxNum = {10,16,18,18,18,18,18,18,18,18}
local RBingo = {8,9,10,12,14,17,18,19,20,21}
local WBingo = {0,24,25,26,28,29}  --围选2--5中少一个奖级 eg 围2中 1个 29代表围5中3的奖级
--判断字符串
function judge_str( num , max)
        local out = ""
        local st = {}
        if num == nil then return nil end
        local len = string.len( num )
		if len % 2 ~= 0 then return 0 end

        for i=1,len,2 do
                c = string.sub(num,i,i+1)
                if tonumber(c) > max or tonumber(c) < 1 then return nil end

        end
        return true
end

--数字字符串排序

function sort_str_syw( num )
	num = string.gsub( num, "*", "")
	local out = ""
	local st = {}
	local len = string.len( num )
	for i=1,len,2 do
		table.insert( st, string.sub(num,i,i+1) )
	end
	table.sort(st)
	for i=1,len / 2 do
		out = out..st[i]
	end

	return out

end
--获取字符串中唯一的字符个数

function get_distinct_num( num )
	local dist = {}
	local str = {}
	local out = ""
	local len = string.len( num )
	str = sort_str_syw(num)
	for i=1,len ,2 do
		c = string.sub(str,i,i+1)
		if not in_table( c, dist ) then
			table.insert( dist, c )
		end
	end
	for i = 1,table.getn(dist) do
		out = out..dist[i]
	end
	return	out , table.getn(dist)

end

function check_qyh(butType, inStr)
	local qxStr
	local qjSt
	local butNum = 0
	local butPower = 1
	local butStr = ""
	local itemList = {}
	local itemLen = 0
	local num = 0
	local SortStr = ""
	itemList = Split( inStr, "#" )
	itemLen = table.getn( itemList )

	qjStr = string.gsub( inStr, "#", "0")
	qxStr = string.gsub( qjStr, "*", "0")
	if itemLen > 2 or itemLen < 1 or string.find(qxStr,"%D") then return 0 end

	if tonumber( itemList[2] ) then butPower = tonumber( itemList[2] ) else butPower = 1 end
	if butPower >99 or butPower < 1 then return 0 end
	xStr = string.gsub(itemList[1], "*", "x")
	xItem = Split(xStr, "x")

	for i = 1,#xItem do
		_, distNum = get_distinct_num(xItem[i])
		if distNum ~= string.len(xItem[i]) / 2 then return 0 end
		if string.len(xItem[i]) % 2 ~= 0 then return 0 end
		if not judge_str(xItem[1], 20) then return 0 end
	end
	--围一到围四 u围5
	if butType == '1' or butType == '2' or butType == '3' or butType == '4' or butType == 'u' then
		if #xItem ~= 1 then return 0 end
		if butType == 'u' then butType = '5' end --围5
		num = string.len(xItem[1]) / 2
		if num  > WMaxNum[tonumber(butType)] or num  < tonumber(butType) then return 0 end

		inStr = sort_str(xItem[1],20).."#"..butPower
		butNum = combination(num,tonumber(butType))
	--围二到围四胆拖 围5胆拖
	elseif butType == '5' or butType == '6' or butType == '7' or butType == 'v' then
		if #xItem ~= 2  or is_str_mix(xItem[1],xItem[2]) then return 0 end
		if butType == 'v' then butType = '8' end --围5胆拖
		if (string.len(xItem[1]) / 2 + string.len(xItem[2]) / 2) > 20 or  (string.len(xItem[1]) / 2 + string.len(xItem[2]) / 2) <= (tonumber(butType) - 3) or (string.len(xItem[1]) / 2) >= (tonumber(butType) - 3) then
			return 0
		end
		dStr = sort_str(xItem[1],20)
		tStr = sort_str(xItem[2],20)
		inStr = dStr.."*"..tStr.."#"..butPower
		butNum = combination(string.len(xItem[2]) / 2, tonumber(butType) - 3 - string.len(xItem[1]) / 2)

	--顺一到顺3
	elseif butType == '8' or butType == '9' or butType == 'a' then

		for i=1, #xItem do
			num = num + string.len(xItem[i]) / 2
		end
		if butType == '8' or butType == '9' then
			if #xItem ~= tonumber(butType) - 7 then return 0 end
			if num < tonumber(butType) - 7 or num > SMaxNum[tonumber(butType) - 7] then return 0 end
		else

			if num < 3 or num > SMaxNum[3] or #xItem ~= 3 then return 0 end
		end
		if butType == '9' then
			if  is_str_mix(xItem[1],xItem[2]) then return 0 end
		elseif butType == 'a' then
			if  is_str_mix(xItem[1],xItem[2]) or  is_str_mix(xItem[1],xItem[3]) or is_str_mix(xItem[2],xItem[3]) then return 0 end
		end
		butNum = 1
		for i=1, #xItem do
			butNum = butNum*string.len(xItem[i]) / 2
		end
	--任1到任10
	elseif butType == 'b' or butType == 'c' or butType == 'd' or butType == 'e' or butType == 'f' or butType == 'g' or butType == 'h' or butType == 'i' or butType == 'j' or butType == 'k' then
		butType = string.byte(butType) - string.byte('a')
		if #xItem ~= 1 then return 0 end
		num = string.len(xItem[1]) / 2
		if num > RMaxNum[butType] or num < butType then return 0 end
		butNum = combination(num, butType)
		inStr = sort_str(xItem[1],20).."#"..butPower
	--任2到任10胆拖
	elseif butType == 'l' or butType == 'm' or butType == 'n' or butType == 'o' or butType == 'p' or butType == 'q' or butType == 'r' or butType == 's' or butType == 't'  then
		butType = string.byte(butType) - string.byte('k') + 1
		if #xItem ~= 2 then return 0 end
		for i=1,2 do
			num =num + string.len(xItem[i])/2
		end
		if num > 20 or num < butType + 1 or string.len(xItem[1]) / 2 >= butType then return 0 end
		butNum = combination(string.len(xItem[2]) / 2, butType - string.len(xItem[1]) / 2)
		dStr = sort_str(xItem[1],20)
		tStr = sort_str(xItem[2],20)
		inStr = dStr.."*"..tStr.."#"..butPower

	end

	return butNum,butPower,inStr,inStr
end
function query_qyh(butType,queryStr,djStr)
	local nBingo = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	local temp 	 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
	local butPower = 1
	local bingoNum = 0
	local bingoD = 0
	local bingoT = 0
	local bullStr = {}
	local butStr = {}
	local szTemp = {}
	local xItem
	itemList = Split( queryStr, "#" )
	if tonumber( itemList[2] ) then butPower = tonumber( itemList[2] ) else butPower = 1 end

	for i = 1, string.len(djStr), 2 do
		bullStr[(i+1)/2] = string.sub(djStr,i,i + 1)
	end

	xStr = string.gsub(itemList[1], "*", "x")
	xItem = Split(xStr, "x")

	--围一
	if butType == '1'then
		butType = tonumber(butType)
		bingoNum = ConputeBingoNum(itemList[1], string.sub(djStr, 1, butType*2) , 2)
		if bingoNum == 1 then nBingo[4] = 1 end
	--围二
	elseif butType == '2' then
		butType = tonumber(butType)
		--围二全中
		bingoNum = ConputeBingoNum(itemList[1], string.sub(djStr, 1, butType*2) , 2)
		if bingoNum == 2 then
			nBingo[5] = 1
			nBingo[24] = string.len(itemList[1])/2-2
		end
		--围二中前一
		bingoNum = ConputeBingoNum(itemList[1], string.sub(djStr, 1, (butType-1)*2) , 2)
		if bingoNum == 1 and nBingo[5] == 0 then nBingo[24] = string.len(itemList[1])/2-1 end
	--围三
	elseif butType == '3' then
		butType = tonumber(butType)
		--围3全中
		bingoNum = ConputeBingoNum(itemList[1], string.sub(djStr, 1, butType*2) , 2)
		if bingoNum == 3 then
			nBingo[6] = 1
			nBingo[25] = string.len(itemList[1])/2-3
		end
		--围3中2
		bingoNum = ConputeBingoNum(itemList[1], string.sub(djStr, 1, (butType-1)*2) , 2)
		if bingoNum == 2 and nBingo[6] == 0 then nBingo[25] = string.len(itemList[1])/2-2 end
	--围四
	elseif butType == '4' then
		butType = tonumber(butType)
		--围4全中
		bingoNum = ConputeBingoNum(itemList[1], string.sub(djStr, 1, butType*2) , 2)
		if bingoNum == 4 then
			nBingo[7] = 1
			nBingo[26] = string.len(itemList[1])/2-4
		end
		--围4中3
		bingoNum = ConputeBingoNum(itemList[1], string.sub(djStr, 1, (butType-1)*2) , 2)
		if bingoNum == 3 and nBingo[7] == 0 then nBingo[26] = string.len(itemList[1])/2-3 end
	--围5
	elseif butType == 'u' then
		butType = 5
		--围5全中
		bingoNum = ConputeBingoNum(itemList[1], string.sub(djStr, 1, butType*2) , 2)
		if bingoNum == 5 then
			nBingo[27] = 1
			nBingo[28] = string.len(itemList[1])/2-5
			nBingo[29] = combination(string.len(itemList[1])/2-5, 2)
		end
		--围5中4
		bingoNum = ConputeBingoNum(itemList[1], string.sub(djStr, 1, (butType-1)*2) , 2)
		if bingoNum == 4 and nBingo[27] == 0  then
			nBingo[28] = string.len(itemList[1])/2-4
			nBingo[29] = combination(string.len(itemList[1])/2-4, 2)
		end
		--围5中3
		bingoNum = ConputeBingoNum(itemList[1], string.sub(djStr, 1, (butType-2)*2) , 2)
		if bingoNum == 3 and nBingo[27] == 0 and nBingo[28] == 0 then nBingo[29] = combination(string.len(itemList[1])/2-3, 2) end




	--围二胆拖
	elseif butType == '5' then
		butType = 2
		bingoD = ConputeBingoNum(xItem[1], string.sub(djStr, 1, butType*2), 2)
		bingoT = ConputeBingoNum(xItem[2], string.sub(djStr, 1, butType*2), 2)
		--围2全中
		if bingoD ==  string.len(xItem[1]) / 2 and bingoT + bingoD == 2 then
			nBingo[5] = 1
			--
			nBingo[24] = string.len(xItem[2])/2 - 1
		else
			bingoD = ConputeBingoNum(xItem[1], string.sub(djStr, 1, (butType-1)*2), 2)
			bingoT = ConputeBingoNum(xItem[2], string.sub(djStr, 1, (butType-1)*2), 2)
			--围2中1
			if bingoT  == 1  then
				nBingo[24] = 1
			elseif bingoD == 1 then
				nBingo[24] = string.len(xItem[2])/2
			end
		end
	--围3
	elseif butType == '6' then
		butType = 3
		bingoD = ConputeBingoNum(xItem[1], string.sub(djStr, 1, butType*2), 2)
		bingoT = ConputeBingoNum(xItem[2], string.sub(djStr, 1, butType*2), 2)
		--围3全中
		if bingoD ==  string.len(xItem[1]) / 2 and bingoT + bingoD == 3 then
			nBingo[6] = 1
		end
		bingoD = ConputeBingoNum(xItem[1], string.sub(djStr, 1, (butType-1)*2), 2)
		bingoT = ConputeBingoNum(xItem[2], string.sub(djStr, 1, (butType-1)*2), 2)
		--围3中2
		if string.len(xItem[1])/2 == 1 and bingoD == 0 and bingoT == 2 then
			nBingo[25] = 1
		elseif string.len(xItem[1])/2 == 1 and bingoD == 1 and bingoT == 1 then
			nBingo[25] = string.len(xItem[2])/2 - 1
		elseif string.len(xItem[1])/2 == 2 and bingoD == 1 and bingoT == 1 then
			nBingo[25] = 1
		elseif string.len(xItem[1])/2 == 2 and bingoD == 2 and bingoT == 0 then
			nBingo[25] = string.len(xItem[2])/2
		end
		if nBingo[6] ==1 then nBingo[25] = nBingo[25] - 1 end

	--围4
	elseif butType == '7' then
		butType = 4
		bingoD = ConputeBingoNum(xItem[1], string.sub(djStr, 1, butType*2), 2)
		bingoT = ConputeBingoNum(xItem[2], string.sub(djStr, 1, butType*2), 2)
		--围4全中
		if bingoD ==  string.len(xItem[1]) / 2 and bingoT + bingoD == 4 then
			nBingo[7] = 1
		end

		bingoD = ConputeBingoNum(xItem[1], string.sub(djStr, 1, (butType-1)*2), 2)
		bingoT = ConputeBingoNum(xItem[2], string.sub(djStr, 1, (butType-1)*2), 2)
		--围4中3 1个胆
		if string.len(xItem[1])/2 == 1 and bingoD == 0 and bingoT == 3 then
			nBingo[26] = 1
		elseif string.len(xItem[1])/2 == 1 and bingoD == 1 and bingoT == 2 then
			nBingo[26] = string.len(xItem[2])/2 -2
		--2个胆
		elseif string.len(xItem[1])/2 == 2 and bingoD == 1 and bingoT == 2 then
			nBingo[26] = 1
		elseif string.len(xItem[1])/2 == 2 and bingoD == 2 and bingoT == 1 then
			nBingo[26] = string.len(xItem[2])/2 -1
		--3个胆
		elseif string.len(xItem[1])/2 == 3 and bingoD == 2 and bingoT == 1 then
			nBingo[26] = 1
		elseif string.len(xItem[1])/2 == 3 and bingoD == 3 and bingoT == 0 then
			nBingo[26] = 1
		end
		if nBingo[7] == 1 then
			nBingo[26] = nBingo[26] - 1
		end

	--围5
	elseif butType == 'v' then
		butType = 5
		bingoD = ConputeBingoNum(xItem[1], string.sub(djStr, 1, butType*2), 2)
		bingoT = ConputeBingoNum(xItem[2], string.sub(djStr, 1, butType*2), 2)
		--围5全中
		if bingoD ==  string.len(xItem[1]) / 2 and bingoT + bingoD == 5 then
			nBingo[27] = 1
		end

		bingoD = ConputeBingoNum(xItem[1], string.sub(djStr, 1, (butType-1)*2), 2)
		bingoT = ConputeBingoNum(xItem[2], string.sub(djStr, 1, (butType-1)*2), 2)
		--围5中4 1个胆
		if string.len(xItem[1]) == 1 and bingoD == 0 and bingoT == 4 then
			nBingo[28] = 1
		elseif string.len(xItem[1]) == 1 and bingoD == 1 and bingoT == 3 then
			nBingo[28] = string.len(xItem[2])/2 - 3
		--2个胆
		elseif string.len(xItem[1])/2 == 2 and bingoD == 1 and bingoT == 3 then
			nBingo[28] = 1
		elseif string.len(xItem[1])/2 == 2 and bingoD == 2 and bingoT == 2 then
			nBingo[28] = string.len(xItem[2])/2 - 2
		--3个胆
		elseif string.len(xItem[1])/2 == 3 and bingoD == 2 and bingoT == 2 then
			nBingo[28] = 1
		elseif string.len(xItem[1])/2 == 3 and bingoD == 3 and bingoT == 1 then
			nBingo[28] = string.len(xItem[2])/2 - 1
		--4个胆
		elseif string.len(xItem[1])/2 == 4 and bingoD == 3 and bingoT == 1 then
			nBingo[28] = 1
		elseif string.len(xItem[1])/2 == 4 and bingoD == 4 and bingoT == 0 then
			nBingo[28] = string.len(xItem[2])/2

		end

		bingoD = ConputeBingoNum(xItem[1], string.sub(djStr, 1, (butType-2)*2), 2)
		bingoT = ConputeBingoNum(xItem[2], string.sub(djStr, 1, (butType-2)*2), 2)
		--围5中3 1个胆
		if string.len(xItem[1])/2 == 1 and bingoD == 0 and bingoT == 3 then
			nBingo[29] = string.len(xItem[2])/2 - 3
		elseif string.len(xItem[1])/2 == 1 and bingoD == 1 and bingoT == 2 then
			nBingo[29] = combination(string.len(xItem[2])/2 - 2, 2)
		--2个胆
		elseif string.len(xItem[1])/2 == 2 and bingoD == 0 and bingoT == 3 then
			nBingo[29] = 1
		elseif string.len(xItem[1])/2 == 2 and bingoD == 1 and bingoT == 2 then
			nBingo[29] = string.len(xItem[2])/2 - 2
		elseif string.len(xItem[1])/2 == 2 and bingoD == 2 and bingoT == 1 then
			nBingo[29] = combination(string.len(xItem[2])/2 - 1, 2)
		--3个胆
		elseif string.len(xItem[1])/2 == 3 and bingoD == 1 and bingoT == 2 then
			nBingo[29] = 1
		elseif string.len(xItem[1])/2 == 3 and bingoD == 2 and bingoT == 1 then
			nBingo[29] = string.len(xItem[2])/2 - 1
		elseif string.len(xItem[1])/2 == 3 and bingoD == 3 and bingoT == 0 then
			nBingo[29] = combination(string.len(xItem[2])/2, 2)
		--4个胆
		elseif string.len(xItem[1])/2 == 4 and bingoD == 2 and bingoT == 1 then
			nBingo[29] = 1
		elseif string.len(xItem[1])/2 == 4 and bingoD == 3 and bingoT == 0 then
			nBingo[29] = string.len(xItem[2])/2

		end

		if nBingo[27] == 1 then
			nBingo[28] = nBingo[28] -1
			nBingo[29] = nBingo[29] - nBingo[28] - nBingo[27]
		end

		if nBingo[27] ~= 1 and nBingo[28] ~= 0 then
			nBingo[29] = nBingo[29] - nBingo[28]
		end

	elseif butType == '8' or butType == '9' or butType == 'a' then
		nBingoPos = {0,0,0}
		for i=1, #xItem do
			for j = 1, string.len(xItem[i]), 2 do
				butStr[(j+1)/2] = string.sub(xItem[i],j,j + 1)
			end
			for k=1,#butStr do
				if butStr[k] == bullStr[i] then
					bingoNum = bingoNum + 1
					nBingoPos[i] = 1
				end
			end
		end
		if butType == '8' or butType == '9' then
			butType = tonumber(butType) - 7
			if butType == bingoNum then
				nBingo[butType] = 1
			elseif butType == 2 and nBingoPos[1] == 1 then
				nBingo[22] = 1
			end
		else
			if 3 == bingoNum then
				nBingo[3] = 1
			elseif butType == 'a' and nBingoPos[1] == 1 and nBingoPos[2] == 1 then
				nBingo[23] = 1
			end
		end
	--任1到任10
	elseif butType == 'b' or butType == 'c' or butType == 'd' or butType == 'e' or butType == 'f' or butType == 'g' or butType == 'h' or butType == 'i' or butType == 'j' or butType == 'k' then
		butType = string.byte(butType) - string.byte('a')
		bingoNum = ConputeBingoNum(itemList[1], djStr, 2)
		if bingoNum >= butType then
			nBingo[RBingo[butType]] = combination(bingoNum, butType)
			if butType == 3 or butType == 4 then
				nBingo[RBingo[butType] + 1] = combination(bingoNum, butType - 1) * (string.len(itemList[1]) / 2 - bingoNum)
			elseif butType == 5 then
				nBingo[RBingo[butType] + 1] = combination(bingoNum, butType - 1) * (string.len(itemList[1]) / 2 - bingoNum)
				nBingo[RBingo[butType] + 2] = combination(bingoNum, butType - 2) * combination((string.len(itemList[1]) / 2 - bingoNum), 2)
			end
		elseif bingoNum == 2 and butType == 3 then
			nBingo[11] = string.len(itemList[1]) / 2 - 2
		elseif bingoNum == 3 and butType == 4 then
			nBingo[13] = string.len(itemList[1]) / 2 - 3
		elseif bingoNum == 4 and butType == 5 then
			nBingo[15] = string.len(itemList[1]) / 2 - 4
		elseif bingoNum == 3 and butType == 5 then
			nBingo[16] = combination(string.len(itemList[1]) / 2 - 3, 2)
		elseif bingoNum == 5 and butType > 5 then
			nBingo[RBingo[butType]] = combination(string.len(itemList[1]) / 2 - bingoNum, butType - bingoNum)
		end
	--任2到任10胆拖
	elseif butType == 'l' or butType == 'm' or butType == 'n' or butType == 'o' or butType == 'p' or butType == 'q' or butType == 'r' or butType == 's' or butType == 't'  then
		lenD = string.len(xItem[1])/2
		lenT = string.len(xItem[2])/2
		butType = string.byte(butType) - string.byte('k') + 1
		bingoD = ConputeBingoNum(xItem[1], djStr, 2)
		bingoT = ConputeBingoNum(xItem[2], djStr, 2)
		if bingoD == string.len(xItem[1]) / 2 then
			nBingo[RBingo[butType]] =combination(bingoT, butType-lenD)
			if bingoD + bingoT < butType and butType <= 5 then
				if butType == 3 and bingoD + bingoT == 2 then
					nBingo[11] = combination(lenD + lenT -2, 1)
				elseif butType == 4 and bingoD+bingoT == 3 then
					nBingo[13] = combination(lenD + lenT - 3, 1)
				elseif butType == 5 and bingoD+bingoT == 4 then
					nBingo[15] = combination(lenD + lenT - 4, 1)
				elseif butType == 5 and bingoD+bingoT == 3 then
					nBingo[15] = combination(lenD + lenT - 3, 2)
				end
			elseif butType == 3 then
				nBingo[11] = (lenT - bingoT) * combination(bingoT, 2 - bingoD)
			elseif butType == 4 then
				nBingo[13] = (lenT - bingoT) * combination(bingoT, 3 - bingoD)
			elseif butType == 5 then
				nBingo[15] = (lenT - bingoT) * combination(bingoT, 4 - bingoD)
				nBingo[16] = (lenT - bingoT) * combination(bingoT, 3 - bingoD)
			elseif butType > 5 and bingoD + bingoT == 5 then
				nBingo[RBingo[butType]] = 1
			end
		elseif butType == 3 then
			if lenD == 1  then
				nBingo[11] = combination(bingoT, 2)
			elseif lenD == 2 and bingoD == 1 then
				nBingo[11] = combination(bingoT, 1)
			end
		elseif butType == 4 then
			if lenD == 1 then
				nBingo[13] = combination(bingoT, 3)
			elseif lenD == 2 and bingoD == 1 then
				nBingo[13] = combination(bingoT, 2)
			elseif lenD == 3 and bingoD == 2 then
				nBingo[13] = combination(bingoT, 1)
			end
		elseif butType == 5 then
			if lenD == 1 then
				nBingo[15] = combination(bingoT, 4)
				nBingo[16] = combination(bingoT, 3) * combination(lenT - bingoT, 1)
			elseif lenD == 2 and bingoD == 1 then
				nBingo[15] = combination(bingoT, 3)
				nBingo[16] = combination(bingoT, 2) * combination(lenT - bingoT, 1)
			elseif lenD == 2 and bingoD == 0 then
				nBingo[16] = combination(bingoT, 3)
			elseif lenD == 3 and bingoD == 1 then
				nBingo[16] = combination(bingoT, 2)
			elseif lenD == 3 and bingoD == 2 then
				nBingo[15] = combination(bingoT, 2)
				nBingo[16] = combination(bingoT, 1) * combination(lenT - bingoT, 1)

			elseif lenD == 4 and bingoD == 2 then
				nBingo[16] = combination(bingoT, 1)
			elseif lenD == 4 and bingoD == 3 then
				nBingo[15] = combination(bingoT, 1)
				nBingo[16] = combination(lenT - bingoT, 1)
			end
		elseif butType > 5 and bingoD + bingoT == 5 and bingoT + lenD <= butType then
			nBingo[RBingo[butType]] = 1
		end
	end
	for i=1 ,29 do
		nBingo[i] = nBingo[i] * butPower
	end
	return nBingo[1]..","..nBingo[2]..","..nBingo[3]..","..nBingo[4]..","..nBingo[5]..","..nBingo[6]..","..nBingo[7]..","..nBingo[8]..","..nBingo[9]..","..nBingo[10]..","..nBingo[11]..","..nBingo[12]..","..nBingo[13]..","..nBingo[14]..","..nBingo[15]..","..nBingo[16]..","..nBingo[17]..","..nBingo[18]..","..nBingo[19]..","..nBingo[20]..","..nBingo[21]..","..nBingo[22]..","..nBingo[23]..","..nBingo[24]..","..nBingo[25]..","..nBingo[26]..","..nBingo[27]..","..nBingo[28]..","..nBingo[29]
end
--print("1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9")
--print(check_qyh('u',"0215171920#1"))
--print(query_qyh('u',"0102030409060708#1","0102030405"))
--print(check_qyh('d',"132022#1"))
--print(query_qyh('9',"04*13#1", "0513171506"))
